package cn.yunyichina.provider.base.dao;

import cn.yunyichina.provider.base.entity.Department;
import cn.yunyichina.provider.base.vo.DepartmentVo;
import cn.yunyichina.provider.framework.page.PageInfo;
import cn.yunyichina.provider.iface.entity.base.Org;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import cn.yunyichina.provider.framework.annotation.MyBatisRepository;
import cn.yunyichina.provider.framework.mvc.dao.BaseDao;

import java.util.List;

/**
*
* @Author auto_gen_by_tool
* @CreatedTime 2016-09-19 15:08:58
*/
@Repository
@MyBatisRepository
public interface DepartmentDao extends BaseDao<cn.yunyichina.provider.base.entity.Department>{

    /**
     * 科室分级查询
     * @param pageInfo
     * @return
     */
    List<DepartmentVo> selectDept(@Param("pageInfo") PageInfo pageInfo , @Param("hospitalId")String hospitalId);


    /**
     * 科室分级查询
     * @return
     */
    String selectDeptCount(@Param("hospitalId")String hospitalId);


    /**
     * 根据username查询Org信息
     * @param userame
     * @return
     */
    List<Org> selectHospitalCode(@Param("userame") String userame);


    /**
     * 根据hospitalid查询一级科室下所有二级科室
     * @param userame
     * @return
     */
    List<Department> selectGetDept(@Param("hospitalId") String hospitalId , @Param("pid") String pid);


    /**
     * 根据hospitalid查询所有非当前科室一级级科室
     * @param hospitalId
     * @param deptId
     * @return
     */
    List<Department> selectGetOneDept(@Param("hospitalId") String hospitalId , @Param("deptId") String deptId);


    /**
     * 根据hospitalid查询所有一级级科室
     * @param hospitalId
     * @return
     */
    List<Department> selectGetOneDeptEx(@Param("hospitalId") String hospitalId);


    /**
     * 根据department 名称绝对查询
     * @param hospitalId
     * @return
     */
    List<Department> selectDeptByName(@Param("wheres") Department wheres);

}